<% @page_title = 'New Post' -%>
<% @blog_controls << link_to('Cancel New Post', session[:history]) -%>
<% @blog_controls << link_to('Log Out', :controller => 'login', :action => 'logout') -%>

<h1>New Post</h1>

<%= render :partial => 'shared/error_notice', :locals => { :error => flash[:error], :notice => flash[:notice] } %>

<% form_for :post, @post, :url => { :action => :new } do |f| %>
	<p>
		<label for="post_title">Title:</label><br />
		<%= f.text_field :title, :class => 'fixed' %>
	</p>
	<p>
		<label for="post_markdown_text">Markdown Text:</label><br />
		<%= f.text_area :markdown_text, :class => 'fixed', :cols => 60, :rows => 24 %>
	</p>
	<p>
		<label for="tag_list">Tags:</label><br />
		<%= text_field_tag 'tag_list', params[:tag_list], :autocomplete => 'off', :class => 'fixed' %>
		<%= submit_tag 'Create Post', :class => 'submit' %>
	</p>
<% end -%>

<% if request.get? -%>
	<%= javascript_tag "$('post_title').focus();" %>
<% end -%>
